<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: PS2Controller Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 Display Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classfabgl_1_1_p_s2_controller.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classfabgl_1_1_p_s2_controller-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">PS2Controller Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>The PS2 device controller class.  
 <a href="classfabgl_1_1_p_s2_controller.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="ps2controller_8h_source.html">ps2controller.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ab8520612804a921ad834b41214a99c09"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_ab8520612804a921ad834b41214a99c09.html#ab8520612804a921ad834b41214a99c09">begin</a> (gpio_num_t port0_clkGPIO, gpio_num_t port0_datGPIO, gpio_num_t port1_clkGPIO=GPIO_UNUSED, gpio_num_t port1_datGPIO=GPIO_UNUSED)</td></tr>
<tr class="memdesc:ab8520612804a921ad834b41214a99c09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes PS2 device controller.  <a href="classfabgl_1_1_p_s2_controller_ab8520612804a921ad834b41214a99c09.html#ab8520612804a921ad834b41214a99c09">More...</a><br /></td></tr>
<tr class="separator:ab8520612804a921ad834b41214a99c09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1312be7041fb5bb2a7d3eaf936265bcd"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_a1312be7041fb5bb2a7d3eaf936265bcd.html#a1312be7041fb5bb2a7d3eaf936265bcd">begin</a> (<a class="el" href="group___enumerations_gaca5d0f920057bf01d133384645a654da.html#gaca5d0f920057bf01d133384645a654da">PS2Preset</a> preset=<a class="el" href="group___enumerations_gaca5d0f920057bf01d133384645a654da.html#ggaca5d0f920057bf01d133384645a654daa930833460d824d9daf937c25c8b7ed74">PS2Preset::KeyboardPort0_MousePort1</a>, <a class="el" href="group___enumerations_ga5d7071ad7a22fa20e52ba3e855cb4cff.html#ga5d7071ad7a22fa20e52ba3e855cb4cff">KbdMode</a> keyboardMode=<a class="el" href="group___enumerations_ga5d7071ad7a22fa20e52ba3e855cb4cff.html#gga5d7071ad7a22fa20e52ba3e855cb4cffa382b3f9e2c83958197e451c23d848f97">KbdMode::CreateVirtualKeysQueue</a>)</td></tr>
<tr class="memdesc:a1312be7041fb5bb2a7d3eaf936265bcd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes PS2 device controller using default GPIOs.  <a href="classfabgl_1_1_p_s2_controller_a1312be7041fb5bb2a7d3eaf936265bcd.html#a1312be7041fb5bb2a7d3eaf936265bcd">More...</a><br /></td></tr>
<tr class="separator:a1312be7041fb5bb2a7d3eaf936265bcd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af28e64e8efcf41c65043da5a1659fe79"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_af28e64e8efcf41c65043da5a1659fe79.html#af28e64e8efcf41c65043da5a1659fe79">dataAvailable</a> (int PS2Port)</td></tr>
<tr class="memdesc:af28e64e8efcf41c65043da5a1659fe79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines if one byte has been received from the specified port.  <a href="classfabgl_1_1_p_s2_controller_af28e64e8efcf41c65043da5a1659fe79.html#af28e64e8efcf41c65043da5a1659fe79">More...</a><br /></td></tr>
<tr class="separator:af28e64e8efcf41c65043da5a1659fe79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c687ceea5dc73f9c2cfee2c0b5ebe34"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_a6c687ceea5dc73f9c2cfee2c0b5ebe34.html#a6c687ceea5dc73f9c2cfee2c0b5ebe34">disableRX</a> (int PS2Port)</td></tr>
<tr class="memdesc:a6c687ceea5dc73f9c2cfee2c0b5ebe34"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables inputs from PS/2 port driving the CLK line Low.  <a href="classfabgl_1_1_p_s2_controller_a6c687ceea5dc73f9c2cfee2c0b5ebe34.html#a6c687ceea5dc73f9c2cfee2c0b5ebe34">More...</a><br /></td></tr>
<tr class="separator:a6c687ceea5dc73f9c2cfee2c0b5ebe34"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afbd77f408f7e0e90acad462c6b31b151"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_afbd77f408f7e0e90acad462c6b31b151.html#afbd77f408f7e0e90acad462c6b31b151">enableRX</a> (int PS2Port)</td></tr>
<tr class="memdesc:afbd77f408f7e0e90acad462c6b31b151"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables inputs from PS/2 port releasing CLK line.  <a href="classfabgl_1_1_p_s2_controller_afbd77f408f7e0e90acad462c6b31b151.html#afbd77f408f7e0e90acad462c6b31b151">More...</a><br /></td></tr>
<tr class="separator:afbd77f408f7e0e90acad462c6b31b151"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8b89edd051fb303d479797506958ab4"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_ae8b89edd051fb303d479797506958ab4.html#ae8b89edd051fb303d479797506958ab4">getData</a> (int PS2Port, int timeOutMS)</td></tr>
<tr class="memdesc:ae8b89edd051fb303d479797506958ab4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a scancode from the queue.  <a href="classfabgl_1_1_p_s2_controller_ae8b89edd051fb303d479797506958ab4.html#ae8b89edd051fb303d479797506958ab4">More...</a><br /></td></tr>
<tr class="separator:ae8b89edd051fb303d479797506958ab4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7edd03d6ed3b8e198f534703afd95e4"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classfabgl_1_1_p_s2_controller.html">PS2Controller</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_ab7edd03d6ed3b8e198f534703afd95e4.html#ab7edd03d6ed3b8e198f534703afd95e4">instance</a> ()</td></tr>
<tr class="memdesc:ab7edd03d6ed3b8e198f534703afd95e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the singleton instance of <a class="el" href="classfabgl_1_1_p_s2_controller.html" title="The PS2 device controller class.">PS2Controller</a> class.  <a href="classfabgl_1_1_p_s2_controller_ab7edd03d6ed3b8e198f534703afd95e4.html#ab7edd03d6ed3b8e198f534703afd95e4">More...</a><br /></td></tr>
<tr class="separator:ab7edd03d6ed3b8e198f534703afd95e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e4c9b217d63aeaf19870e5f88c88d9e"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classfabgl_1_1_keyboard.html">Keyboard</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_a9e4c9b217d63aeaf19870e5f88c88d9e.html#a9e4c9b217d63aeaf19870e5f88c88d9e">keyboard</a> ()</td></tr>
<tr class="memdesc:a9e4c9b217d63aeaf19870e5f88c88d9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the instance of <a class="el" href="classfabgl_1_1_keyboard.html" title="The PS2 Keyboard controller class.">Keyboard</a> object automatically created by <a class="el" href="classfabgl_1_1_p_s2_controller.html" title="The PS2 device controller class.">PS2Controller</a>.  <a href="classfabgl_1_1_p_s2_controller_a9e4c9b217d63aeaf19870e5f88c88d9e.html#a9e4c9b217d63aeaf19870e5f88c88d9e">More...</a><br /></td></tr>
<tr class="separator:a9e4c9b217d63aeaf19870e5f88c88d9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6142e99b5efb8d565ffea27b6fb50315"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_a6142e99b5efb8d565ffea27b6fb50315.html#a6142e99b5efb8d565ffea27b6fb50315">lock</a> (int PS2Port, int timeOutMS)</td></tr>
<tr class="memdesc:a6142e99b5efb8d565ffea27b6fb50315"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets exclusive access to the specified PS/2 port.  <a href="classfabgl_1_1_p_s2_controller_a6142e99b5efb8d565ffea27b6fb50315.html#a6142e99b5efb8d565ffea27b6fb50315">More...</a><br /></td></tr>
<tr class="separator:a6142e99b5efb8d565ffea27b6fb50315"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11a1921444fc60b10cf161f433b55499"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classfabgl_1_1_mouse.html">Mouse</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_a11a1921444fc60b10cf161f433b55499.html#a11a1921444fc60b10cf161f433b55499">mouse</a> ()</td></tr>
<tr class="memdesc:a11a1921444fc60b10cf161f433b55499"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the instance of <a class="el" href="classfabgl_1_1_mouse.html" title="The PS2 Mouse controller class.">Mouse</a> object automatically created by <a class="el" href="classfabgl_1_1_p_s2_controller.html" title="The PS2 device controller class.">PS2Controller</a>.  <a href="classfabgl_1_1_p_s2_controller_a11a1921444fc60b10cf161f433b55499.html#a11a1921444fc60b10cf161f433b55499">More...</a><br /></td></tr>
<tr class="separator:a11a1921444fc60b10cf161f433b55499"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1aec7cc0cf5296ccfacd12a38bdd0485"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_a1aec7cc0cf5296ccfacd12a38bdd0485.html#a1aec7cc0cf5296ccfacd12a38bdd0485">sendData</a> (uint8_t <a class="el" href="displaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21.html#a96db82e580e46e24e2b39dd6c5bf7c21">data</a>, int PS2Port)</td></tr>
<tr class="memdesc:a1aec7cc0cf5296ccfacd12a38bdd0485"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a command to the device.  <a href="classfabgl_1_1_p_s2_controller_a1aec7cc0cf5296ccfacd12a38bdd0485.html#a1aec7cc0cf5296ccfacd12a38bdd0485">More...</a><br /></td></tr>
<tr class="separator:a1aec7cc0cf5296ccfacd12a38bdd0485"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab247f0736097d58dd4625fb2de3e05b6"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_p_s2_controller_ab247f0736097d58dd4625fb2de3e05b6.html#ab247f0736097d58dd4625fb2de3e05b6">unlock</a> (int PS2Port)</td></tr>
<tr class="memdesc:ab247f0736097d58dd4625fb2de3e05b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases port from exclusive access.  <a href="classfabgl_1_1_p_s2_controller_ab247f0736097d58dd4625fb2de3e05b6.html#ab247f0736097d58dd4625fb2de3e05b6">More...</a><br /></td></tr>
<tr class="separator:ab247f0736097d58dd4625fb2de3e05b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >The PS2 device controller class. </p>
<p >The PS2 controller uses ULP coprocessor and RTC slow memory to communicate with up to two PS2 devices.<br  />
 The ULP coprocessor continuously monitor CLK and DATA lines for incoming data. Optionally can send commands to the PS2 devices. </p>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="_others_2_keyboard_scan_codes_2_keyboard_scan_codes_8ino-example.html#_a2">Others/KeyboardScanCodes/KeyboardScanCodes.ino</a>, <a class="el" href="_others_2_keyboard_virtual_keys_2_keyboard_virtual_keys_8ino-example.html#_a2">Others/KeyboardVirtualKeys/KeyboardVirtualKeys.ino</a>, <a class="el" href="_others_2_mouse_studio_2_mouse_studio_8ino-example.html#_a0">Others/MouseStudio/MouseStudio.ino</a>, <a class="el" href="_s_s_d1306__o_l_e_d_2128x64_2_network_terminal_2_network_terminal_8ino-example.html#_a2">SSD1306_OLED/128x64/NetworkTerminal/NetworkTerminal.ino</a>, <a class="el" href="_s_s_d1306__o_l_e_d_2128x64_2_r_t_clock_2_r_t_clock_8ino-example.html#_a3">SSD1306_OLED/128x64/RTClock/RTClock.ino</a>, <a class="el" href="_s_s_d1306__o_l_e_d_2128x64_2_u_i_2_u_i_8ino-example.html#_a1">SSD1306_OLED/128x64/UI/UI.ino</a>, <a class="el" href="_s_t7789__t_f_t_2240x240_2_file_browser_2_file_browser_8ino-example.html#_a1">ST7789_TFT/240x240/FileBrowser/FileBrowser.ino</a>, <a class="el" href="_v_g_a_2_altair8800_2_altair8800_8ino-example.html#_a8">VGA/Altair8800/Altair8800.ino</a>, <a class="el" href="_v_g_a_2_ansi_terminal_2_ansi_terminal_8ino-example.html#_a1">VGA/AnsiTerminal/AnsiTerminal.ino</a>, <a class="el" href="_v_g_a_2_audio_2_audio_8ino-example.html#_a1">VGA/Audio/Audio.ino</a>, <a class="el" href="_v_g_a_2_classic_racer_2_classic_racer_8ino-example.html#_a2">VGA/ClassicRacer/ClassicRacer.ino</a>, <a class="el" href="_v_g_a_2_direct_v_g_a__el_muro_2_direct_v_g_a__el_muro_8ino-example.html#_a1">VGA/DirectVGA_ElMuro/DirectVGA_ElMuro.ino</a>, <a class="el" href="_v_g_a_2_file_browser_2_file_browser_8ino-example.html#_a1">VGA/FileBrowser/FileBrowser.ino</a>, <a class="el" href="_v_g_a_2_graphical_user_interface_2_graphical_user_interface_8ino-example.html#_a1">VGA/GraphicalUserInterface/GraphicalUserInterface.ino</a>, <a class="el" href="_v_g_a_2_hardware_test_2_hardware_test_8ino-example.html#_a1">VGA/HardwareTest/HardwareTest.ino</a>, <a class="el" href="_v_g_a_2_loopback_terminal_2_loopback_terminal_8ino-example.html#_a1">VGA/LoopbackTerminal/LoopbackTerminal.ino</a>, <a class="el" href="_v_g_a_2_mouse_on_screen_2_mouse_on_screen_8ino-example.html#_a2">VGA/MouseOnScreen/MouseOnScreen.ino</a>, <a class="el" href="_v_g_a_2_multitasking_c_p_m_2_multitasking_c_p_m_8ino-example.html#_a1">VGA/MultitaskingCPM/MultitaskingCPM.ino</a>, <a class="el" href="_v_g_a_2_network_terminal_2_network_terminal_8ino-example.html#_a1">VGA/NetworkTerminal/NetworkTerminal.ino</a>, <a class="el" href="_v_g_a_2_songs_2_songs_8ino-example.html#_a2">VGA/Songs/Songs.ino</a>, <a class="el" href="_v_g_a_2_sound_chip_simulator_2_sound_chip_simulator_8ino-example.html#_a2">VGA/SoundChipSimulator/SoundChipSimulator.ino</a>, <a class="el" href="_v_g_a_2_space_invaders_2_space_invaders_8ino-example.html#_a2">VGA/SpaceInvaders/SpaceInvaders.ino</a>, and <a class="el" href="_v_g_a_2_v_i_c20_2_v_i_c20_8ino-example.html#_a2">VGA/VIC20/VIC20.ino</a>.</dd>
</dl>

<p class="definition">Definition at line <a class="el" href="ps2controller_8h_source.html#l00082">82</a> of file <a class="el" href="ps2controller_8h_source.html">ps2controller.h</a>.</p>
</div><hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="ps2controller_8h_source.html">ps2controller.h</a></li>
<li><a class="el" href="ps2controller_8cpp_source.html">ps2controller.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>fabgl</b></li><li class="navelem"><a class="el" href="classfabgl_1_1_p_s2_controller.html">PS2Controller</a></li>
    <li class="footer">Generated on Mon Aug 29 2022 13:52:06 for FabGL by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
  </ul>
</div>
</body>
</html>
